package UIComponents
{
	import Classes.GameUtils.MyTipSprite;
	import Classes.GameUtils.ToolTip_Sprite;
	import Classes.staticinfo.Language;
	
	import MyComponent.MyButton;
	
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	import flash.display.Sprite;
	import flash.text.TextField;
	
	public class SellectWeaponsPanel extends Sprite
	{
		private var ic:IconContainer;
		public var fm:DisplayObject;
		public var iuserItem:IUseItem;
		public var xs:TextField;
		public var lock:DisplayObject;
		public var weaponId:Number;
		public var wqNumber:DisplayObjectContainer;
		
		public function SellectWeaponsPanel()
		{
			init();
		}
		
		private function init():void
		{
			this.ic=this.getChildByName("picIcon") as IconContainer;
			this.fm=this.getChildByName("fm");
			this.wqNumber=this.getChildByName("wqNumber") as DisplayObjectContainer;
			this.xs=this.wqNumber.getChildByName("txt") as TextField;
			this.lock=this.getChildByName("lock");
			this.lock.visible=true;
			
			ToolTip_Sprite.getInstance().setTip( this.getChildByName("button_close") as MyButton, new MyTipSprite(Language.upDownWeaponDown));
		}
		
		public function setSelectItemWeanpon(_iuserItem:IUseItem,_xs:int):void
		{
			reset();
			this.weaponId=_iuserItem.itemId;
			this.ic.addPic(_iuserItem.itemPic,_iuserItem.itemName+"："+_iuserItem.description);
			this.fm.visible=false;
			this.xs.text=String(_xs+1);
		}
		
		private function reset():void
		{
			this.ic.addPic(null);
			this.fm.visible=true;
			this.xs.text="";
		}
		
	}
}